﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChessTest.Chess.Items
{
    /**
     * 只能走一步的
     */
    public abstract class OneStepItem : Chessman
    {
        protected override bool IsOverstep(Chessboard chessboard, int x, int y)
        {
            if (base.IsOverstep(chessboard, x, y))
                return true;

            //是不是只走一步
            if (Math.Abs(x - PositionX) + Math.Abs(y - PositionY) != 1)
                return true;

            return false;
        }
    }
}
